package com.warm.mini.wework.service.invoke;

import com.warm.mini.wework.config.WeworkConfigProperties;
import com.warm.mini.wework.feign.WeworkApiRest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Description AccessTokenServiceImpl
 * @Author warmchuang
 * @Date 2022/2/11 16:42
 */
@Service
@Slf4j
public class AccessTokenServiceImpl {

    public String getAccessToken(WeworkConfigProperties config){
        return getAccessToken(config.getCorpId(), config.getCorpSecret());
    }

    public String getAccessToken(String corpId, String corpSecret){
        return WeworkApiRest.get().gettoken(corpId, corpSecret);
    }
}
